-- NewTitlePanel

local NewListAdapterTool = require("app.widget.NewListAdapterTool")
local TitleRender = import(".renders.TitleRender")

local ClassRef = app.mvc.createPanelClass(...)

function ClassRef.create(node)
	local sprite = ClassRef.extend(node or cc.CSLoader:createNode(Res.NewBagTitleNode))
	if node == nil then
		ccui.Helper:doLayout(sprite)
	end
	sprite:init()
	return sprite
end

function ClassRef:init(data)
	self.super.init(self, data)

	local params = {
		list = self._ui["Panel/ScrollView"],
		subPanelClass = TitleRender
	}
	self._nodeTemp = NewListAdapterTool.new( params )
end

function ClassRef:getScrollView()
	return self._nodeTemp
end

function ClassRef:remove()
end

function ClassRef:registerOnOperate( cb )
	self._nodeTemp:setSubPanelCB( cb )
end

return ClassRef
